x86/mem_sharing: For shared pages with many references, use a hash table
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 26 Apr 2012 09:03:08 +0000 (10:03 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 26 Apr 2012 09:03:08 +0000 (10:03 +0100)
commit99169e3037660a1a44127b92d35344e864489c3c
tree6472d3516159c0998a440476ed6e8e52862e2c17
parent01b962bd49be2804ae9a12413d4a6667ba221552
x86/mem_sharing: For shared pages with many references, use a hash table

For shared frames that have many references, the doubly-linked list used to
store the rmap results in costly scans during unshare operations. To alleviate
the overhead, replace the linked list by a hash table. However, hash tables are
space-intensive, so only use them for pages that have "many" (arbitrary
threshold) references.

Unsharing is heaviliy exercised during domain destroy. In experimental testing,
for a domain that points over 100 thousand pages to the same shared frame,
domain destruction dropped from over 7 minutes(!) to less than two seconds.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/mem_sharing.c
xen/include/asm-x86/mem_sharing.h